<?php
/**
 * MVC Controller
 * Ein-Ausgabe-Verarbeitung
 *
 * @author		Joachim Ruf
 * @copyright	Copyright (c) 2003-2013 Loresoft Software (http://www.loresoft.de)
 * @license		http://yapary.loresoft.de/lizenzbedingungen     New BSD License
 *
 * */


Class Yapary_MVC_SimpleMVC_Controller
{
	protected $registry;
	protected $view;
	protected $model;
	protected $partial;
	private   $arrRef	= array();
	protected $arrRoute = array();


    /**
	* @desc Yapary_MVC_SimpleMVC_Controller
	*/
	function __construct(	Yapary_MVC_SimpleMVC_View &$_oView,
							&$_oModel,
							Yapary_MVC_SimpleMVC_Partial &$_oPartial,
							array &$_arrRoute,
							array &$_arrRef = array()
	) {
		$this->registry			= Yapary_MVC_SimpleMVC_Registry::getInstance();

		/* var $_oView Yapary_MVC_SimpleMVC_View */
		$this->view				= &$_oView;
		/* var $_oModel Yapary_MVC_SimpleMVC_Model */
		$this->model			= &$_oModel;
		/* var $_oPartial Yapary_MVC_SimpleMVC_Partial */
		$this->partial			= &$_oPartial;
		/* var $_arrRoute	Routenpfa und Parameter */
		$this->arrRoute			= $_arrRoute;

		$this->arrRef			= &$_arrRef;
		$this->arrRef['template'] = NULL;
		$this->arrRef['forwarding'] = NULL;
	}


	public function setTemplate ($_defaultTemplate) {
		$this->arrRef['template'] = $_defaultTemplate;
	}


	public function setContentType ($_contentType, $_outputEncoding = NULL) {
		if ($_outputEncoding !== NULL) {
			$GLOBALS['outputEncoding']	= $_outputEncoding;
		}
		$GLOBALS['contentType'] 	= $_contentType;
	}


	/**
	 * Laedt Controller und Action und bricht ab diesem Zeitpunkt das alte MVC-Kontrukt ab
	 * @param string $_mvcToLoad    : Name/Pfadname des zu ladenden MVC-Models im Format: dir1_dir2_classname.php
	 * @param string $_actionname   : Name der vom Controller auszufuehrende Action
	 * @param array $_arrActionVars : an die Action uz uebergebende Variablen
	 * @return void
	 */
	public function forwarding ($_controllerName, array $_arrParam = array()) {
		$this->arrRef['forwarding'] = $_controllerName;
	}



}


?>